package com.xinyue.game.client.network;

import com.xinyue.network.message.ChannelConfirmMessageRequest;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Author 王广帅
 * @Date 2021/1/31 0:44
 */
public class ChannelConfirmHandler extends ChannelInboundHandlerAdapter {
    private Logger logger = LoggerFactory.getLogger(ChannelConfirmHandler.class);
    private String token = "sdfsddsfdsfdf";

    @Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {
        logger.info("发送连接认证消息");
        ChannelConfirmMessageRequest request = new ChannelConfirmMessageRequest();
        request.setToken(token);
        ctx.write(request);
    }
}
